<script setup lang="ts">
import { reactive } from "vue";
import dayjs from 'dayjs';
import type {DateDataType} from "./index.d"
import {useSettingStore} from "@/stores/index"

const dateData = reactive<DateDataType>({
  dateDay: "",
  dateYear: "",
  dateWeek: "",
  timing: null
});

const { setSettingShow} =useSettingStore()
const weekday= ["周日", "周一", "周二", "周三", "周四", "周五", "周六"]
const timeFn = () => {
  dateData.timing = setInterval(() => {
    dateData.dateDay = dayjs().format("YYYY-MM-DD hh : mm : ss");
    dateData.dateWeek = weekday[dayjs().day()];
  }, 1000);
};
timeFn()
</script>

<template>
  <div class="d-flex jc-center title_wrap">
    <div class="d-flex jc-center">
      <div class="title">
        <span class="title-text">金凤区数字供销平台</span>
        <span class="web-sec-name web-name">金凤区数字供销大数据驾驶舱</span>
      </div>

    </div>
    <div class="timers">
<!--      {{ dateData.dateYear }} {{ dateData.dateWeek }} {{ dateData.dateDay }}-->
    </div>
  </div>
</template>

<style scoped lang="less">
.title_wrap {
  z-index: 2;
  width: 100%;
  height: 60px;
  background-image: url("../assets/img/top_bg.png");
  background-size: cover;
  background-position: center center;
  position: absolute;
  margin-bottom: 4px;
  left: 4px;
  top: 0;

  .web-name{
    position: absolute;
    font-size: 24px;
    width: 581px;
    height: 48px;
    top: 60px;
    letter-spacing: 10px;
    font-family: 黑体;
    line-height: 48px;
    transform: translateX(-50%);
    font-weight: 700;
    background: url(../assets/img/subheading.png) no-repeat 50%;
    left: 50%;
    letter-spacing: 15px;
    text-align: center;
    font-weight: 400;
    color: #eff8fc;
    opacity: .89;
  }



  .timers {
    position: absolute;
    right: 3%;
    top: 3%;
    font-size: 18px;
    display: flex;
    align-items: center;

    .setting_icon {
      width: 20px;
      height: 20px;
      cursor: pointer;
      margin-left: 12px;
      img{
        width: 100%;
        height: 100%;
      }
    }
  }
}
.title {
  position: relative;
  // width: 500px;
  text-align: center;
  background-size: cover;
  color: transparent;
  height: 60px;
  line-height: 46px;

  .title-text {
    font-size: 38px;
    letter-spacing: 15px;
    text-align: center;
    font-family: YouSheBiaoTiHei-2;
    font-weight: 400;
    width: 100%;
    background: #eff8fc;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
</style>
